
<script setup>
import useMenu from '@/stores/menu'
import { useRouter } from 'vue-router'
const router = useRouter()
const menuStore = useMenu()

const login = async () => {
  // let rs = await fetch('/api/test')
  // let ff = await rs.text()
  // console.log(ff)
  // const menuStore = useMenu()
  console.log(menuStore)
  if(!menuStore.getMenuFlag) {
    let data = [
      {name: '菜单1', code: 'test'},
      {name: '菜单2', code: 'test2'},
    ]
    menuStore.setMenuList(data)
  }
  router.push('/test')
}
</script>

<template>
  <div>
    login hkhkhjkhhkj
    <el-button @click="login">提交</el-button>
  </div>
</template>